<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<script type="text/javascript">

	/**查找带回机构信息*/
	function lookUpNetsite() {
		$.pdialog.open('netsiteLookUp', 'organization', '网点信息', {
			width : 1000,
			height : 580,
			mask : true
		});
	}
	/** 导出*/
	function exportCourierExcel(){  
	  var userName =document.getElementById("userNameId").value;
	  var netSiteId =document.getElementById("courierNesiteId").value;
     location.href="<%=basePath%>exportCouriersAction?userName="+userName+"&netSiteId="+netSiteId;   
 	}  
</script>
<c:if test="${code==1}">
	<form id="pagerForm" method="post" action="courierAction.action?toResult=searchCourier&rightId=${rightId}">
		<input type="hidden" name="pageNum" value="${page.currentPage }" /> 
		<input type="hidden" name="pageSize" value="${page.pageSize }" />
		<input  type="hidden" name="netSiteName" value="${netSiteName}"  size="30" />
		 <input type="hidden" name="netSiteId" value="${netSiteId}"/>
	</form>
 
	<form onsubmit="return navTabSearch(this);" action="courierAction.action?toResult=searchCourier&rightId=${rightId}" method="post">
		<div class="pageHeader">
			<input type="hidden" name="init" value=0>
			<div class="searchBar">
				<table class="searchContent">
					<tr>
						<td>快递网点：</td>
							<td width=""><a class="btnLook"
									href="javascript:void(0);" onclick="lookUpNetsite()">									
									查找带回</a><input id="searchCompany_netsiteName" type="text" name="netSiteName" bringBackName="netSiteName"
									 value="${netSiteName}" readonly="readonly" size="30" />
									 <input type="hidden" id="courierNesiteId"
									name="netSiteId" value="${netSiteId}" bringBackName="netSiteId"/></td>
						<td>用户名: <input id="userNameId" type="text" name="username" />
						<td>电话: <input id="mobileId" type="text" name="mobile" />
						</td>			
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td>
							<div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="pageContent">
			<div class="panelBar">
				<ul class="toolBar">
					<c:forEach items="${righSubtList}" var="rightsub">
						<!-- 导出快递员 -->
						<c:if test="${fn:contains(rightsub.rightValue,'exportCouriersAction')}">
							<button type="button" onclick="exportCourierExcel()">导出快递员信息</button>	
						</c:if>
						<!-- 添加  -->
						<c:if test="${fn:contains(rightsub.rightValue,'addCourier')}">
							<li><a class="add" href="${rightsub.rightValue}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 修改  -->
						<c:if test="${fn:contains(rightsub.rightValue,'updateCourier')}">
							<li><a class="edit" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 物理删除 -->
						<c:if test="${fn:contains(rightsub.rightValue,'deleteCourier')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="ajaxTodo" title="确认要删除吗？"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 逻辑删除 -->
						<c:if test="${fn:contains(rightsub.rightValue,'deleteCouDeleteFlag')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="ajaxTodo" title="确认要删除吗？"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 评分 -->
						<c:if test="${fn:contains(rightsub.rightValue,'courierGrade')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 审核 -->
						<c:if test="${fn:contains(rightsub.rightValue,'checkCourier')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>

					</c:forEach>
				</ul>
			</div>
			<table class="list" width="100%" layoutH="138">
				<thead>
					<tr>
						<th align="center">序号</th>
						<th align="center">用户名</th>
						<th align="center">状态</th>
						<th align="center">电话</th>
						<th align="center">真实姓名</th> 
						<th align="center">性别</th>
						<th align="center">所属网点</th>
						<th align="center">评分等级</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator var="courier" value="page.data" status="st">
						<tr target="sid_support" rel="<s:property value="#courier.id" />">
							<th width="1%" align="center"><s:property value="page.pageSize * (page.currentPage-1) + #st.index + 1" />
							</th>
							<th width="5%" align="left"><s:property value="#courier.username" />
							</th>
							<th width="5%" align="left">
								<s:if test="#courier.locked ==0"><span style="color:blue">启用</span></s:if> 
								<s:elseif test="#courier.locked ==1"><span style="color:gray">禁用</span></s:elseif>
							</th>
							<th width="5%" align="left"><s:property value="#courier.mobile" />
							</th>
							<th width="5%" align="left"><s:property value="#courier.realname" />
							</th> 
							<th width="5%" align="left">
								<s:if test="#courier.gender ==0">女</s:if> 
								<s:elseif test="#courier.gender ==1">男</s:elseif>
							</th>
							<th width="5%" align="left"><s:property value="#courier.netSiteName" />
							</th>
							<th width="5%" align="left"><s:property value="#courier.grade" />
							</th>
						</tr>
					</s:iterator>
				</tbody>
			</table>
			<div class="panelBar">
				<div class="pages">
					<span>共${page.totalNum }条，共${page.totalPage }页</span>
				</div>
				<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
			</div>
		</div>
	</form>
</c:if>
<c:if test="${code==0}">
	${message}
</c:if>